<ui:composition template="/xhtml/component/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:t="http://myfaces.apache.org/tomahawk">
	<ui:define name="page">
		<h:form prependId="false">
			<p:outputPanel layout="block">
			<p:panel header="Recommendation details">
				<h:panelGrid columns="1" width="100%" style="text-align: center;">
					<h:panelGrid columns="2">
						<h:outputText value="#{msg.label_user_email}:" style="font-weight: bold;"/>
						<h:outputText value="#{recommenderBean.selectedUser.email}" />
					</h:panelGrid>
					<br/>
					<p:dataTable var="neighbor"	value="#{recommenderBean.neighbors}">
						<p:column>
							<f:facet name="header">
								<h:outputText value="Type/Context" />
							</f:facet>
							<h:outputText value="#{neighbor.type}" />
						</p:column>		
						<p:column>
							<f:facet name="header">
								<h:outputText value="#{msg.label_preferences_movies_context}" />
							</f:facet>
							 <p:dataList value="#{neighbor.moviesNeighbors}" var="user" itemType="square">  
							    <h:outputText value="#{user.email}"/>  
							</p:dataList>
						</p:column>	
						<p:column>
							<f:facet name="header">
								<h:outputText value="#{msg.label_preferences_singers_context}" />
							</f:facet>
							<p:dataList value="#{neighbor.singersNeighbors}" var="user" itemType="square" style="border-color: white;">  
							    <h:outputText value="#{user.email}"/>  
							</p:dataList>
						</p:column>	
						<p:column>
							<f:facet name="header">
								<h:outputText value="#{msg.label_preferences_books_context}" />
							</f:facet>
							<p:dataList value="#{neighbor.booksNeighbors}" var="user" itemType="square">  
							    <h:outputText value="#{user.email}"/>  
							</p:dataList>
						</p:column>				
					</p:dataTable>					
				</h:panelGrid>
			</p:panel>	
			</p:outputPanel>			
			<p:messages id="messages" showDetail="true" rendered="false"/>
			<br />
			<p:outputPanel layout="block">								
			<p:tabView>
				<p:tab title="#{msg.label_preferences_movies_context}">
					<ui:include src="/xhtml/recommendation/movieRecommendations.xhtml" />
				</p:tab>	
				<p:tab title="#{msg.label_preferences_singers_context}">
					<ui:include src="/xhtml/recommendation/singerRecommendations.xhtml" />
				</p:tab>
				<p:tab title="#{msg.label_preferences_books_context}">
					<ui:include src="/xhtml/recommendation/bookRecommendations.xhtml" />
				</p:tab>
			</p:tabView>	
			</p:outputPanel>	
			<br />		
			<p:commandButton id="btnBackUserPreferences" value="#{msg.label_back}" ajax="false"
				action="#{recommenderBean.backToUsersList}" />
		</h:form>
	</ui:define>
</ui:composition>